<?php
defined('BASEPATH') OR exit('No direct script access allowed');


use QCloud_WeApp_SDK\Mysql\Mysql as DB;


class OrderFindByOrderNum extends CI_Controller
{

    public function index()
    {
        $ordernum = $_POST['ordernum'];
        $userid = $_POST['userid'];
        $remark = $_POST['remark'];
        $name = $_POST['name'];
        $mobile = $_POST['mobile'];
        $sheng = $_POST['sheng'];
        $shi = $_POST['shi'];
        $qu = $_POST['qu'];
        $address = $_POST['address'];
        $zt = $_POST['zt'];
        $zffs = $_POST['zffs'];

        DB::update('cc_order',['ordernum' => $ordernum, 'userid' => $userid,
            'remark' => $remark, 'name' => $name,'mobile' => $mobile,'sheng' => $sheng,
            'shi' => $shi,'qu' => $qu,'address' => $address,'zt' => $zt,'zffs' => $zffs,
        ], ['userid' => $userid, 'ordernum' => $ordernum]);

        $rows = DB::row('cc_order',['*'], ['ordernum' => $ordernum, 'userid' => $userid]);


        if (!empty($rows)) {
            $this->json([
                'code' => 0,
                'data' => $rows
            ]);
        } else {
            $this->json([
                'code' => -1,
                'error' => $rows['error']
            ]);
        }
    }
}
